package com.smartrodin.springbootkafka.service;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

/**
 * @author: arnold_nie
 * @date: 2020/8/18 21:07
 * FileName: SimpleListener
 * Description:
 */
@Component
public class SimpleListener {

    @KafkaListener(topics = {"topic1", "topic2"})
    public void listen1(ConsumerRecord record, Acknowledgment ack) {
        System.out.println(record.value());
        ack.acknowledge();
    }
}
